import request from '@/utils/request'

// 创建积分配置
export function createIntegral(data) {
  return request({
    url: '/exam/integral/create',
    method: 'post',
    data: data
  })
}

// 更新积分配置
export function updateIntegral(data) {
  return request({
    url: '/exam/integral/update',
    method: 'put',
    data: data
  })
}

// 删除积分配置
export function deleteIntegral(id) {
  return request({
    url: '/exam/integral/delete?id=' + id,
    method: 'delete'
  })
}

// 获得积分配置
export function getIntegral(id) {
  return request({
    url: '/exam/integral/get?id=' + id,
    method: 'get'
  })
}

// 获得积分配置分页
export function getIntegralPage(query) {
  return request({
    url: '/exam/integral/page',
    method: 'get',
    params: query
  })
}

// 导出积分配置 Excel
export function exportIntegralExcel(query) {
  return request({
    url: '/exam/integral/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
